
<%@page import="entity.User"%>
<%@page import="model.Action"%>
<%@page import="entity.DVPT"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%

    DVPT dvpt= new  DVPT();
    ResultSet rs=dvpt.selectDB();
           

%>

<style type="text/css">
<!--
.stylex1 {
	color: #FF6600
}
-->
</style>

<p>&nbsp;</p>
<p align="center" class="titleU">THÊM NGƯỜI DÙNG</p>
<p>&nbsp;</p>
<div class="divlon">
  <form id="form1" name="form1" method="post" action="/quanlyphonghoc/adduser">
    
      <table width="547" border="1" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="145" height="25" align="right" valign="middle"><strong>Username&nbsp;</strong></td>
          <td align="left" valign="top"><label>
                  <input name="username" type="text" id="username" size="50" onchange="check_if(this.value, 'a1','/quanlyphonghoc/ajax/ajax.jsp?key=username&&value=' )">
          <span class="stylex1">*</span> <span id=a1> </span></label></td>
        </tr>
        <tr>
          <td width="145" height="25" align="right" valign="middle"><strong>Password&nbsp;</strong></td>
          <td align="left" valign="top"><label>
            <input name="pass" type="password" id="pass" size="30">
            <span class="stylex1">*</span><span ></span></label></td>
        </tr>
        <tr>
          <td width="145" height="25" align="right" valign="middle"><strong>Nhập Lại Password&nbsp;</strong></td>
          <td align="left" valign="top"><label>
                  <input name="pass2" type="password" id="pass2" size="30" onchange="check_if(this.value, 'a2','/quanlyphonghoc/ajax/ajax.jsp?key=pass&&value='+pass.value+'&&pass2=' )">
            <span class="stylex1">*</span><span id=a2></span></label></td>
        </tr>
        <tr>
          <td width="145" height="25" align="right" valign="middle"><strong>Họ và Tên&nbsp;</strong></td>
    <td width="396" align="left" valign="top"><label>
            <input name="name" type="text" id="name" value="" size="50" />
          </label></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Ngày Sinh &nbsp; </strong></td>
        <td align="left" valign="top"><input type="text" name="birthday" id="birthday" onClick="return showCalendar('birthday', '%d-%m-%Y');" value="" size="43"
><input type="button" value=" ... " onClick="return showCalendar('birthday', '%d-%m-%Y');">        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Giới Tính &nbsp; </strong></td>
          <td align="left" valign="top">&nbsp;
        
            <label>
                <input name="sex" type="radio" id="sex_0" value="1" checked="checked" />
              Nam</label>
            <label>
              <input type="radio" name="sex" value="0" id="sex_1" />
              Nữ</label>
            <br />          </td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>E-Mail &nbsp; </strong></td>
          <td align="left" valign="top">
              <input name="email" type="text" id="email" value="" size="50" onchange="check_if(this.value, 'a3','/quanlyphonghoc/ajax/ajax.jsp?key=email&&value=' )"/>
          <span class="stylex1">*</span><span id=a3></span></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Số Điện Thoại &nbsp; </strong></td>
          <td align="left" valign="top"><input name="phone" type="text" id="phone" value="" size="50" /></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Đơn Vị Phụ Trách &nbsp;</strong></td>
          <td align="left" valign="top"><label>
          <select name="dvpt" id="dvpt">
              
              <% while(rs.next()){ %>
              <option value="<%=rs.getString("iddvpt") %>" > <%=rs.getString("TenDV")  %></option>
            <%}%>
          </select>
          </label></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Đơn Vị Công Tác &nbsp; </strong></td>
          <td align="left" valign="top"><input name="dvct" type="text" id="dvct" value="" size="50"/></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Nghề Nghiệp &nbsp; </strong></td>
          <td align="left" valign="top"><input name="job" type="text" id="job" value="" size="50"/></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="middle"><strong>Địa Chỉ &nbsp; </strong></td>
          <td align="left" valign="top"><input name="address" type="text" id="address" value="" size="50" /></td>
        </tr>
        
        <tr>
          <td height="25" align="right" valign="top"><strong>Quyền Hạn &nbsp;</strong></td>
          <td align="left" valign="top"><label>
            <select name="lev" id="lev">
                <option value="0" selected="selected">Chưa Xác Định</option>
              <option value="1" >Thành Viên</option>
              <option value="2" >Quản Lý</option>
            </select>
          </label></td>
        </tr>
        <tr>
          <td height="25" align="right" valign="top"><strong>Trạng Thái &nbsp;</strong></td>
          <td align="left" valign="top">&nbsp;
            <label>
              <input type="radio" name="active" value="1" id="active_0"  />
              Kích Hoạt</label>
            <label>
              <input type="radio" name="active" value="0" id="active_1"  checked="checked" />
              Không Kích Hoạt</label>            <br />          </td>
        </tr>
        
      </table>
<br />
      <br />      
      <div align="center">
        <input type="submit" name="them" id="them" value="Thêm Mới" />
        
</div>
  </form><form action="manageusers.jsp">
        <input type="submit" name="thoat" id="thoat" value="Thoát" />
        </form>
  <p>&nbsp;</p>
</div>
<br />
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>